
const url = 'http://47.99.88.10:8080/'

//vue-cli3将webpack的基础配置全部内嵌了,预留了一个vue.config.js的js文件对webpack进行自定义配置
const webpack = require('webpack');
module.exports = {
    publicPath: process.env.VUE_APP_PUBLIC_PATH,
    lintOnSave: false,  //eslint-loader 是否在保存的时候检查
    productionSourceMap: false,
    configureWebpack: {
        plugins: [
            //在插件中实例化
            new webpack.ProvidePlugin({
                $: "jquery",
                jQuery: "jquery",
                jquery: "jquery",
                "windows.jQuery": "jquery"
            }),
        ],
        //资源(asset)和入口起点超过指定文件限制
        performance: {
            hints:false
        },


    },
    chainWebpack: config => {
        const entry = config.entry('app');
        entry
            .add('babel-polyfill')
            .end();
        entry
            .add('classlist-polyfill')
            .end()
    },
    // 配置转发代理
    devServer: {
        proxy: {
            '/oauth': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/oauth': '/oauth'
                }
            },
            '/token': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/token': '/token'
                }
            },
            '/mobile': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/mobile': '/mobile'
                }
            },
            '/admin': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/admin': '/admin'
                }
            },
            '/code': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/code': '/code'
                }
            },
            '/gen': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/gen': '/gen'
                }
            },
            '/daemon': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/daemon': '/daemon'
                }
            },
            '/tx': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/tx': '/tx'
                }
            },
            '/act': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/act': '/act'
                }
            },
            '/planning': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/planning': '/planning'
                }
            },
            '/im': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/im': '/im'
                }
            },
            '/subject': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/subject': '/subject'
                }
            },
            '/news': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/news': '/news'
                }
            },
            '/review': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/review': '/review'
                }
            },
            '/pim': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/pim': '/pim'
                }
            },
            '/make': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/make': '/make'
                }
            },
            '/file': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/file': '/file'
                }
            },
            '/annex': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/annex': '/annex'
                }
            },
            '/opinion': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/opinion': '/opinion'
                }
            },
            '/statisticsNew': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/statisticsNew': '/statisticsNew'
                }
            },
            '/bpmLanguage': {
                target: url,
                ws: true,
                pathRewrite: {
                    '^/bpmLanguage': '/bpmLanguage'
                }
            },
        }
    }
};
